Object.defineProperty(exports, "__esModule", {
  value: !0
}), exports.checkPayReleasePopup = function (e, r) {
  return u.apply(this, arguments)
}, exports.reqCancelRelease = function (e) {
  return i.apply(this, arguments)
}, exports.reqCancelTop = function (e) {
  return f.apply(this, arguments)
}, exports.reqInfoRefresh = function (e, r) {
  return l.apply(this, arguments)
}, exports.reqRepublish = function (e) {
  return p.apply(this, arguments)
}, exports.reqRestoreTop = function (e) {
  return m.apply(this, arguments)
}, exports.sendMachineInfo = function (e, r) {
  return a.apply(this, arguments)
};
var e = require("../../../@babel/runtime/helpers/objectSpread2"),
  r = require("../../../@babel/runtime/helpers/regeneratorRuntime"),
  t = require("../../../@babel/runtime/helpers/slicedToArray"),
  n = require("../../../@babel/runtime/helpers/asyncToGenerator"),
  o = require("../../../store/index"),
  c = require("../../tools/index"),
  s = require("../common/index");

function u() {
  return (u = n(r().mark((function e(n, o) {
    var c, s, u, a, i;
    return r().wrap((function (e) {
      switch (e.prev = e.next) {
        case 0:
          return e.next = 2, $.request["POST/v2/machine/is-free-publish?source=XCX"]({
            mode: n
          }, {
            "content-type": "application/json"
          });
        case 2:
          return c = e.sent, s = t(c, 1), u = s[0], a = u.code, i = u.content, e.abrupt("return", 200 != a || i.hasFreePublishNum ? (null == o || o(!1), !1) : ($.jxAlert({
            mode: "confirm",
            content: i.publishRefuseReason || [],
            confirmText: "确认发布",
            cancelText: "取消"
          }).then((function () {
            null == o || o(!0)
          })), !0));
        case 8:
        case "end":
          return e.stop()
      }
    }), e)
  })))).apply(this, arguments)
}

function a() {
  return (a = n(r().mark((function n(s, u) {
    var a, i, p, l, f, m, d, x, h, b, g;
    return r().wrap((function (r) {
      switch (r.prev = r.next) {
        case 0:
          if (a = getCurrentPages(), console.log(u), i = a[a.length - 2], p = o.store.getState(), l = p.storage, f = l.userInfo, m = c.common.compactObj(s), console.log(m), console.log(s), !u) {
            r.next = 12;
            break
          }
          return r.next = 9, m.cityId = m.city_id, m.cityText = m.city_text, m.provinceId = m.province_id, m.provinceText = m.province_text, $.request[m.mode == 1 ? "POST/business/seek/rent/edit/" + u : m.mode == 2 ? "POST/business/for/rent/edit/".concat(u) : "POST/business/recruit/worker/edit/" + u](e({}, m), {
            "content-type": "application/json"
          });
        case 9:
          r.t0 = r.sent, r.next = 15;
          break;
        case 12:
          return r.next = 14, m.cityId = m.city_id, m.cityText = m.city_text, m.provinceId = m.province_id, m.provinceText = m.province_text, m.driverTypeId = m.modelId, m.driverTypeName = m.modelName, $.request[m.mode == 1 ? "POST/business/seek/rent/add" : m.mode == 2 ? "POST/business/for/rent/add" :m.mode == 5 ? "POST/business/recruit/worker/add":"POST/business/dishonesty/record/add"](e({}, m), {
            "content-type": "application/json"
          });
        case 14:
          r.t0 = r.sent, r.next = 15;
        case 15:
          console.log(r.sent)
          if (d = r.t0, x = t(d, 1), console.log(t(d, 1)), h = x[0], console.log(h.code), b = h.code, g = h.data, 20002 != b) {
            r.next = 24;
            break
          }
          $.jxAlert({
            mode: "confirm",
            title: "发布成功，信息审核中...",
            content: "",
            confirmText: "",
            cancelText: "返回"
          }).then((function () {
            $.router.replace("/subpackage/topset/rectopmset/index", {
              mode: m.mode,
              uu_id: g.uu_id
            })
          })).catch((function () {
            "pages/recruit/index" == (null == i ? void 0 : i.route) || "subpackage/publish/record-manage/index" == (null == i ? void 0 : i.route) ? $.router.back({
              params: {
                "page-type": "publish"
              }
            }): $.router.push("/pages/index/index", {
              mode: m.mode
            })
          })), r.next = 32;
          break;
        case 24:
          if (303 != b) {
            r.next = 31;
            break
          }
          if (!$.isIos) {
            r.next = 28;
            break
          }
          return "您的鱼泡币余额不足", r.abrupt("return", void $.jxAlert({
            mode: "confirm",
            content: "您的鱼泡币余额不足",
            confirmText: "去获取"
          }).then((function () {
            $.router.push("/subpackage/personal/integral/my-coin/index")
          })));
        case 28:
          1 == f.member_status ? $.jxAlert({
            mode: "confirm",
            hideClose: !0,
            title: "温馨提示",
            content: "您的鱼泡币不足了,是否前往充值",
            cancelText: "取消",
            confirmText: "去充鱼泡币"
          }).then((function () {
            $.router.push("/subpackage/personal/integral/recharge/index")
          })) : $.jxAlert({
            mode: "confirm",
            title: "温馨提示",
            content: "鱼泡币不足，开通会员最高可送3000鱼泡币，还可获得专属会员权益",
            cancelText: "去充鱼泡币",
            confirmText: "去开通会员"
          }).then((function () {
            $.router.push("/subpackage/personal/member/index")
          })).catch((function (e) {
            "cancel" == e && $.router.push("/subpackage/personal/integral/recharge/index")
          })), r.next = 32;
          break;
        case 31:
          $.jxAlert({
            mode: "confirm",
            hideClose: !0,
            title: "温馨提示",
            content: h.msg,
            cancelText: "知道了",
            confirmText: ""
          });
        case 32:
        case "end":
          return r.stop()
      }
    }), n)
  })))).apply(this, arguments)
}

function i() {
  return (i = n(r().mark((function n(o) {
    var c, s, u, a;
    return r().wrap((function (r) {
      switch (r.prev = r.next) {
        case 0:
          return r.next = 2, console.log(o), $.request[o.mode == 1 ? "DELETE/business/seek/rent/del/" + o.info : o.mode == 2 ? "DELETE/business/for/rent/del/" + o.info : "DELETE/business/recruit/worker/del/" + o.info]();
        case 2:
          return c = r.sent, s = t(c, 1), u = s[0], a = u.code, r.abrupt("return", 20002 == a || Promise.reject(new Error(u.msg)));
        case 7:
        case "end":
          return r.stop()
      }
    }), n)
  })))).apply(this, arguments)
}

function p() {
  return (p = n(r().mark((function n(o) {
    var c, s, u, a;
    return r().wrap((function (r) {
      for (;;) switch (r.prev = r.next) {
        case 0:
          return r.next = 2, $.request["GET/user/release-push-again?source=XCX"](e({}, o));
        case 2:
          return c = r.sent, s = t(c, 1), u = s[0], a = u.code, r.abrupt("return", 200 == a || Promise.reject(new Error(u.msg)));
        case 7:
        case "end":
          return r.stop()
      }
    }), n)
  })))).apply(this, arguments)
}

function l() {
  return (l = n(r().mark((function n(c, u) {
    var a, i, p, l, f, m;
    return r().wrap((function (r) {
      for (;;) switch (r.prev = r.next) {
        case 0:
          return a = o.store.getState().global.machineConfig, i = a.refresh_machine_cost_coin, r.next = 4, $.request["GET/user/refresh-save?source=XCX"](e(e({}, c), {}, {
            coin: i
          }));
        case 4:
          return p = r.sent, l = t(p, 1), f = l[0], m = f.code, r.abrupt("return", 200 == m ? (u ? $.jxAlert({
            mode: "confirm",
            hideClose: !0,
            title: "温馨提示",
            content: "刷新成功",
            cancelText: "",
            confirmText: "确定"
          }).then((function () {
            $.router.back()
          })) : $.msg("刷新成功"), !0) : 303 === f.code ? ((0, s.jumpBuyPopup)(), f) : Promise.reject(new Error(f.msg)));
        case 9:
        case "end":
          return r.stop()
      }
    }), n)
  })))).apply(this, arguments)
}

function f() {
  return (f = n(r().mark((function n(o) {
    var c, s, u, a;
    return r().wrap((function (r) {
      for (;;) switch (r.prev = r.next) {
        case 0:
          return r.next = 2, $.request["GET/user/cancel-top?source=XCX"](e({}, o));
        case 2:
          return c = r.sent, s = t(c, 1), u = s[0], a = u.code, r.abrupt("return", 200 == a || Promise.reject(new Error(u.msg)));
        case 7:
        case "end":
          return r.stop()
      }
    }), n)
  })))).apply(this, arguments)
}

function m() {
  return (m = n(r().mark((function n(o) {
    var c, s, u, a;
    return r().wrap((function (r) {
      for (;;) switch (r.prev = r.next) {
        case 0:
          return r.next = 2, $.request["GET/user/set-top?source=XCX"](e({}, o));
        case 2:
          return c = r.sent, s = t(c, 1), u = s[0], a = u.code, r.abrupt("return", 200 == a ? ($.msg("置顶成功"), !0) : Promise.reject(new Error(u.msg)));
        case 7:
        case "end":
          return r.stop()
      }
    }), n)
  })))).apply(this, arguments)
}